home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / fax / src / faxd / FaxRequest.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  4KB  |  101 lines

  1. /*    $Header: /usr/people/sam/fax/faxd/RCS/FaxRequest.h,v 1.30 1994/02/28 14:14:30 sam Rel $ */
  2. /*
  3.  * Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
  4.  * Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and 
  7.  * its documentation for any purpose is hereby granted without fee, provided
  8.  * that (i) the above copyright notices and this permission notice appear in
  9.  * all copies of the software and related documentation, and (ii) the names of
  10.  * Sam Leffler and Silicon Graphics may not be used in any advertising or
  11.  * publicity relating to the software without the specific, prior written
  12.  * permission of Sam Leffler and Silicon Graphics.
  13.  * 
  14.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  15.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  16.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  17.  * 
  18.  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  19.  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  20.  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21.  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  22.  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  23.  * OF THIS SOFTWARE.
  24.  */
  25. #ifndef _FaxRequest_
  26. #define    _FaxRequest_
  27. /*
  28.  * Fax Send/Poll Request Structure.
  29.  */
  30. #include "StrArray.h"
  31. #include <time.h>
  32. #include <stdio.h>
  33.  
  34. #include <InterViews/regexp.h>
  35.  
  36. enum FaxSendOp {
  37.     send_tiff,            // send tiff file
  38.     send_tiff_saved,        // saved tiff file (converted)
  39.     send_postscript,        // send postscript file
  40.     send_postscript_saved,    // saved postscript file (convert to tiff)
  41.     send_poll,            // make poll request
  42. };
  43. fxDECLARE_PrimArray(FaxSendOpArray, FaxSendOp);
  44.  
  45. enum FaxSendStatus {
  46.     send_retry,            // waiting for retry
  47.     send_failed,        // finished w/o success
  48.     send_done,            // completed successfully
  49. };
  50.  
  51. /*
  52.  * This structure is passed from the queue manager (faxServerApp)
  53.  * to the fax modem+protocol service (FaxServer) for each send/poll
  54.  * operation to be done.  This class also supports the read and
  55.  * writing of this information to an external file.
  56.  */
  57. struct FaxRequest {
  58.     enum FaxNotify {        // notification control
  59.     no_notice,        // no notifications
  60.     when_done,        // notify when send completed
  61.     when_requeued        // notify if job requeued
  62.     };
  63.  
  64.     fxStr    qfile;        // associated queue file name
  65.     fxStr    jobid;        // job identifier
  66.     FILE*    fp;        // open+locked queue file
  67.     FaxSendStatus status;    // request status indicator
  68.     u_short    dirnum;        // directory of next page to send
  69.     u_short    npages;        // total pages sent/received
  70.     u_short    ntries;        // # tries to send current page
  71.     u_short    ndials;        // # consecutive failed tries to call dest
  72.     u_short    totdials;    // total # calls to dest
  73.     u_short    maxdials;    // max # calls to make
  74.     u_short    pagewidth;    // desired output page width (mm)
  75.     float    pagelength;    // desired output page length (mm)
  76.     float    resolution;    // desired vertical resolution (lpi)
  77.     time_t    tts;        // time to send
  78.     time_t    killtime;    // time to kill job
  79.     fxStr    sender;        // sender's name
  80.     fxStr    mailaddr;    // return mail address
  81.     fxStr    jobtag;        // user-specified job tag
  82.     fxStr    number;        // dialstring for fax machine
  83.     fxStr    external;    // displayable phone number for fax machine
  84.     FaxSendOpArray ops;        // send-related ops to do
  85.     fxStrArray    files;        // associated files to transmit or polling id's
  86.     FaxNotify    notify;        // email notification indicator
  87.     fxStr    notice;        // message to send for notification
  88.     fxStr    modem;        // outgoing modem to use
  89.     fxStr    pagehandling;    // page analysis information
  90.  
  91.     fxBool checkFile(const char* file);
  92.  
  93.     static Regexp jobidPat;
  94.  
  95.     FaxRequest(const fxStr& qf);
  96.     ~FaxRequest();
  97.     fxBool readQFile(int fd);
  98.     void writeQFile();
  99. };
  100. #endif /* _FaxRequest_ */
  101.